package com;

import com.tool.jdbctool;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class main {
    public static void main(String[] args) {
       save();
    }
    public static void  save(){
        System.out.println("main");
        Connection connection=null;
        PreparedStatement statement=null;
        ResultSet resultSet=null;
        try {
            connection= jdbctool.getconection();
            statement=connection.prepareStatement(
                    "insert into users(`username`,`password`,`sex`,`email`) values(?,?,?,?)");
            statement.setString(1,"username");
            statement.setString(2,"username");
            statement.setString(3,"n");
            statement.setString(4,"username");
            statement.executeUpdate();
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }finally {
            jdbctool.close(connection,statement,resultSet);
        }
    }
}
